package com.wang.interviewtest.mapper;

import com.wang.interviewtest.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 王益波
 * @version 1.0
 * @date 2020/11/13 10:48
 */

public interface UserMapper {
    @Select("select * from user")
    List<User> selectAll();

    @Update("update user set sex=#{sex},update_time=now() where id=#{id}")
    int updateSex(User user);

    @Delete("delete from user ")
    void deleteAll();

    @Delete("delete from user where id=#{id}")
    int deleteById(Long id);


    int insert(User user);


    int update(User user);

}
